<?php
/**
 * Created by IntelliJ IDEA.
 * User: yiane
 * Date: 2019-2-25
 * Time: 1:35
 */

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;

class StatusController extends Controller
{

    /**
     * @OA\Get(
     *     path="/api/status",
     *     tags={"status"},
     *     summary="服务健康检查",
     *     @OA\Response(
     *         response=200,
     *         description="success",
     *         @OA\MediaType(
     *             mediaType="application/json",
     *             @OA\Schema(
     *                 @OA\Property(
     *                     property="status",
     *                     type="integer",
     *                     format="int64",
     *                 ),
     *                 @OA\Property(
     *                     property="msg",
     *                     type="string",
     *                 ),
     *                 example={"status": 200, "msg": "success"}
     *             )
     *         )
     *     ),
     * )
     */
    public function index(){
        return $this->success([]);
    }

    /**
     * @OA\Get(
     *     path="/api/time",
     *     tags={"status"},
     *     summary="服务器时间",
     *     @OA\Response(
     *         response=200,
     *         description="success",
     *         @OA\MediaType(
     *             mediaType="application/json",
     *             @OA\Schema(
     *                 @OA\Property(
     *                     property="status",
     *                     type="integer",
     *                     format="int64",
     *                 ),
     *                 @OA\Property(
     *                     property="msg",
     *                     type="string",
     *                 ),
     *                 example={"status": 200, "data": "2019-03-21 09:00:00","msg": "success"}
     *             )
     *         )
     *     )
     * )
     */
    public function time(){
        return $this->success(date("Y-m-d H:i:s"));
    }
}
